home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume8 / libhoward / part06 < prev    next >
Encoding:
Text File  |  1989-09-30  |  46.7 KB  |  1,681 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v08i084: libhoward portability library, part 6 of 9
  3. from: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  4. Reply-To: howard@dahlbeck.ericsson.se (Howard Gayle)
  5.  
  6. Posting-number: Volume 8, Issue 84
  7. Submitted-by: howard@dahlbeck.ericsson.se (Howard Gayle)
  8. Archive-name: libhoward/part06
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then feed it
  12. # into a shell via "sh file" or similar.  To overwrite existing files,
  13. # type "sh file -c".
  14. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  15. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  16. # If this archive is complete, you will see the following message at the end:
  17. #        "End of archive 6 (of 9)."
  18. # Contents:  ma2d.c ma2i.c ma2l.c malf0.c malf1.c mk-cc-lims.b mk-reg.b
  19. #   mopenp.3 mra2d.c mra2i.c mra2l.c mra2u.c mra2ul.c prefxi.c usage.h
  20. #   userfn.c
  21. # Wrapped by howard@hasse on Mon Sep 25 07:08:11 1989
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'ma2d.c' -a "${1}" != "-c" ; then 
  24.   echo shar: Will not clobber existing file \"'ma2d.c'\"
  25. else
  26. echo shar: Extracting \"'ma2d.c'\" \(3062 characters\)
  27. sed "s/^X//" >'ma2d.c' <<'END_OF_FILE'
  28. X/*
  29. X * ma2d - convert Ada-syntax real literal to double, handle errors
  30. X */
  31. X
  32. X#ifndef lint
  33. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  34. X#endif lint
  35. X
  36. X/*
  37. X * This program is free software; you can redistribute it and/or modify
  38. X * it under the terms of the GNU General Public License version 1,
  39. X * as published by the Free Software Foundation.
  40. X *
  41. X * This program is distributed in the hope that it will be useful,
  42. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  43. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  44. X * GNU General Public License for more details.
  45. X *
  46. X * You should have received a copy of the GNU General Public License
  47. X * along with this program; if not, write to the Free Software
  48. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  49. X */
  50. X
  51. X#include <stdio.h>
  52. X#include <howard/port.h>
  53. X#include <howard/version.h>
  54. X
  55. XMODVER ("@(#)$Header: ma2d.c,v 1.6 89/08/12 08:58:22 howard Exp $");
  56. X
  57. X#include <errno.h>
  58. X#include <float.h>
  59. X#include <limits.h>
  60. X#include <string.h>
  61. X#include <howard/a2.h>
  62. X#include <howard/malf.h>
  63. X#include <howard/registers.i>
  64. X
  65. XPUBLIC double ma2d (str, lim, synok, fn, end)
  66. X   bStrT  str;   /* Input string.*/
  67. X   bStrT  lim;   /* Don't pass this.*/
  68. X   boolT  synok; /* Accept non-fatal syntax errors.*/
  69. X   bStrT  fn;    /* Field name, for error messages.*/
  70. XR2 bStrT *end;   /* End pointer stored here.*/
  71. X
  72. X/* Function:
  73. X *    
  74. X * Algorithm:
  75. X *    Call a2d().  Switch on return code.
  76. X * Returns:
  77. X *    
  78. X * Notes:
  79. X *    
  80. X */
  81. X{
  82. X   bStrT  ep; /* a2d() stores pointer to end of string here.*/
  83. X   double d;  /* a2d() stores its result here.*/
  84. XR3 int    p1; /* Precision for printing str (up to syntax error).*/
  85. XR4 int    p2; /* Precision for printing str (after syntax error).*/
  86. XR1 int    s;  /* Return code.*/
  87. X
  88. Xs = a2d (str, lim, synok, &d, &ep);
  89. Xswitch (s)
  90. X   {
  91. X   case SUCCESS:
  92. X      break;
  93. X   case EDOM:
  94. X      p1 = ep - str;
  95. X      p2 = ((NULBSTR == lim) ? strlen (str) : lim - str) - p1;
  96. X      malf1 ("%s [%.*s|%.*s]: syntax error", fn, p1, str, p2, ep);
  97. X      break;
  98. X   case ERANGE:
  99. X      p1 = ((NULBSTR == lim) ? INT_MAX : lim - str);
  100. X      malf1 ("%s [%.*s] not in range [%G, %G]",
  101. X             fn, p1, str, -DBL_MAX, DBL_MAX);
  102. X      break;
  103. X   case EINVAL:
  104. X      if (NULBSTR == str) malf1 ("ma2d: null string argument");
  105. X      /* Falls through.*/
  106. X   default:
  107. X      malf1 ("ma2d: impossible error %d", s);
  108. X   }
  109. Xif (((bStrT *) NULL) != end) *end = ep;
  110. Xreturn (d);
  111. X}
  112. X
  113. X#ifdef TEST
  114. X#include <howard/usage.h>
  115. X
  116. XMAINVER ("@(#)$Header: ma2d.c,v 1.6 89/08/12 08:58:22 howard Exp $");
  117. XUSAGE ("real-numeric-literal [limit]");
  118. X
  119. XPUBLIC int main (argc, argv)
  120. Xint    argc; /* Number of arguments.*/
  121. XbStrT *argv; /* Points to array of argument strings.*/
  122. X{
  123. XbStrT end; /* Points to end of string.*/
  124. Xdouble d; /* Returned by ma2d().*/
  125. X
  126. Xif (argc < 2) usage();
  127. Xd = ma2d (argv[1], (2 == argc) ? NULBSTR : &argv[1][atoi (argv[2])], FALSE,
  128. X          S("real-numeric-literal"), &end);
  129. XPRINTF ("%G\t%s\n", d, end);
  130. Xmfflush (stdout, "Standard Output");
  131. Xexit (SUCCESS);
  132. X
  133. X#ifdef lint
  134. Xreturn (SUCCESS);
  135. X#endif
  136. X}
  137. X#endif
  138. END_OF_FILE
  139. if test 3062 -ne `wc -c <'ma2d.c'`; then
  140.     echo shar: \"'ma2d.c'\" unpacked with wrong size!
  141. fi
  142. # end of 'ma2d.c'
  143. fi
  144. if test -f 'ma2i.c' -a "${1}" != "-c" ; then 
  145.   echo shar: Will not clobber existing file \"'ma2i.c'\"
  146. else
  147. echo shar: Extracting \"'ma2i.c'\" \(3052 characters\)
  148. sed "s/^X//" >'ma2i.c' <<'END_OF_FILE'
  149. X/*
  150. X * ma2i - convert Ada-syntax integer literal to int, handle errors
  151. X */
  152. X
  153. X#ifndef lint
  154. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  155. X#endif lint
  156. X
  157. X/*
  158. X * This program is free software; you can redistribute it and/or modify
  159. X * it under the terms of the GNU General Public License version 1,
  160. X * as published by the Free Software Foundation.
  161. X *
  162. X * This program is distributed in the hope that it will be useful,
  163. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  164. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  165. X * GNU General Public License for more details.
  166. X *
  167. X * You should have received a copy of the GNU General Public License
  168. X * along with this program; if not, write to the Free Software
  169. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  170. X */
  171. X
  172. X#include <stdio.h>
  173. X#include <howard/port.h>
  174. X#include <howard/version.h>
  175. X
  176. XMODVER ("@(#)$Header: ma2i.c,v 1.6 89/08/12 09:10:44 howard Exp $");
  177. X
  178. X#include <errno.h>
  179. X#include <limits.h>
  180. X#include <string.h>
  181. X#include <howard/a2.h>
  182. X#include <howard/malf.h>
  183. X#include <howard/registers.i>
  184. X
  185. XPUBLIC int ma2i (str, lim, synok, fn, end)
  186. X   bStrT  str;   /* Input string.*/
  187. X   bStrT  lim;   /* Don't pass this.*/
  188. X   boolT  synok; /* Accept non-fatal syntax errors.*/
  189. X   bStrT  fn;    /* Field name, for error messages.*/
  190. XR2 bStrT *end;   /* End pointer stored here.*/
  191. X
  192. X/* Function:
  193. X *    
  194. X * Algorithm:
  195. X *    Call a2i() then switch on return code.
  196. X * Returns:
  197. X *    
  198. X * Notes:
  199. X *    
  200. X */
  201. X{
  202. X   bStrT ep; /* a2i() stores pointer to end of string here.*/
  203. X   int   i;  /* a2i() stores its result here.*/
  204. XR3 int   p1; /* Precision for printing str (up to syntax error).*/
  205. XR4 int   p2; /* Precision for printing str (after syntax error).*/
  206. XR1 int   s;  /* Return code.*/
  207. X
  208. Xs = a2i (str, lim, synok, &i, &ep);
  209. Xswitch (s)
  210. X   {
  211. X   case SUCCESS:
  212. X      break;
  213. X   case EDOM:
  214. X      p1 = ep - str;
  215. X      p2 = ((NULBSTR == lim) ? strlen (str) : lim - str) - p1;
  216. X      malf1 ("%s [%.*s|%.*s]: syntax error", fn, p1, str, p2, ep);
  217. X      break;
  218. X   case ERANGE:
  219. X      p1 = ((NULBSTR == lim) ? INT_MAX : lim - str);
  220. X      malf1 ("%s [%.*s] not in range [%d, %d]", fn, p1, str, INT_MIN, INT_MAX);
  221. X      break;
  222. X   case EINVAL:
  223. X      if (NULBSTR == str) malf1 ("ma2i: null string argument");
  224. X      /* Falls through.*/
  225. X   default:
  226. X      malf1 ("ma2i: impossible error %d", s);
  227. X   }
  228. Xif (((bStrT *) NULL) != end) *end = ep;
  229. Xreturn (i);
  230. X}
  231. X
  232. X#ifdef TEST
  233. X#include <howard/usage.h>
  234. X
  235. XMAINVER ("@(#)$Header: ma2i.c,v 1.6 89/08/12 09:10:44 howard Exp $");
  236. XUSAGE ("integer-numeric-literal [limit]");
  237. X
  238. XPUBLIC int main (argc, argv)
  239. Xint    argc; /* Number of arguments.*/
  240. XbStrT *argv; /* Points to array of argument strings.*/
  241. X{
  242. XbStrT end; /* Points to end of string.*/
  243. Xint i; /* Returned by ma2i().*/
  244. X
  245. Xif (argc < 2) usage();
  246. Xi = ma2i (argv[1], (2 == argc) ? NULBSTR : &argv[1][atoi (argv[2])], FALSE,
  247. X          S("integer-numeric-literal"), &end);
  248. XPRINTF ("8#%o#\t10#%d#\t16#%X#\t%s\n", i, i, i, end);
  249. Xmfflush (stdout, "Standard Output");
  250. Xexit (SUCCESS);
  251. X
  252. X#ifdef lint
  253. Xreturn (SUCCESS);
  254. X#endif
  255. X}
  256. X#endif
  257. END_OF_FILE
  258. if test 3052 -ne `wc -c <'ma2i.c'`; then
  259.     echo shar: \"'ma2i.c'\" unpacked with wrong size!
  260. fi
  261. # end of 'ma2i.c'
  262. fi
  263. if test -f 'ma2l.c' -a "${1}" != "-c" ; then 
  264.   echo shar: Will not clobber existing file \"'ma2l.c'\"
  265. else
  266. echo shar: Extracting \"'ma2l.c'\" \(3037 characters\)
  267. sed "s/^X//" >'ma2l.c' <<'END_OF_FILE'
  268. X/*
  269. X * ma2l - convert Ada-syntax integer literal to long, handle errors
  270. X */
  271. X
  272. X#ifndef lint
  273. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  274. X#endif lint
  275. X
  276. X/*
  277. X * This program is free software; you can redistribute it and/or modify
  278. X * it under the terms of the GNU General Public License version 1,
  279. X * as published by the Free Software Foundation.
  280. X *
  281. X * This program is distributed in the hope that it will be useful,
  282. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  283. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  284. X * GNU General Public License for more details.
  285. X *
  286. X * You should have received a copy of the GNU General Public License
  287. X * along with this program; if not, write to the Free Software
  288. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  289. X */
  290. X
  291. X#include <stdio.h>
  292. X#include <howard/port.h>
  293. X#include <howard/version.h>
  294. X
  295. XMODVER ("@(#)$Header: ma2l.c,v 1.3 89/08/12 09:22:39 howard Exp $");
  296. X
  297. X#include <errno.h>
  298. X#include <limits.h>
  299. X#include <string.h>
  300. X#include <howard/a2.h>
  301. X#include <howard/malf.h>
  302. X#include <howard/registers.i>
  303. X
  304. XPUBLIC long ma2l (str, lim, synok, fn, end)
  305. X   bStrT  str;   /* Input string.*/
  306. X   bStrT  lim;   /* Don't pass this.*/
  307. X   boolT  synok; /* Accept non-fatal syntax errors.*/
  308. X   bStrT  fn;    /* Field name, for error messages.*/
  309. XR2 bStrT *end;   /* End pointer stored here.*/
  310. X
  311. X/* Function:
  312. X *    
  313. X * Algorithm:
  314. X *    
  315. X * Returns:
  316. X *    
  317. X * Notes:
  318. X *    
  319. X */
  320. X{
  321. X   bStrT ep; /* a2l() stores pointer to end of string here.*/
  322. X   long  l;  /* a2l() stores its result here.*/
  323. XR3 int   p1; /* Precision for printing str (up to syntax error).*/
  324. XR4 int   p2; /* Precision for printing str (after syntax error).*/
  325. XR1 int   s;  /* Return code.*/
  326. X
  327. Xs = a2l (str, lim, synok, &l, &ep);
  328. Xswitch (s)
  329. X   {
  330. X   case SUCCESS:
  331. X      break;
  332. X   case EDOM:
  333. X      p1 = ep - str;
  334. X      p2 = ((NULBSTR == lim) ? strlen (str) : lim - str) - p1;
  335. X      malf1 ("%s [%.*s|%.*s]: syntax error", fn, p1, str, p2, ep);
  336. X      break;
  337. X   case ERANGE:
  338. X      p1 = ((NULBSTR == lim) ? INT_MAX : lim - str);
  339. X      malf1 ("%s [%.*s] not in range [%ld, %ld]",
  340. X             fn, p1, str, LONG_MIN, LONG_MAX);
  341. X      break;
  342. X   case EINVAL:
  343. X      if (NULBSTR == str) malf1 ("ma2l: null string argument");
  344. X      /* Falls through.*/
  345. X   default:
  346. X      malf1 ("ma2l: impossible error %d", s);
  347. X   }
  348. Xif (((bStrT *) NULL) != end) *end = ep;
  349. Xreturn (l);
  350. X}
  351. X
  352. X#ifdef TEST
  353. X#include <howard/usage.h>
  354. X
  355. XMAINVER ("@(#)$Header: ma2l.c,v 1.3 89/08/12 09:22:39 howard Exp $");
  356. XUSAGE ("integer-numeric-literal [limit]");
  357. X
  358. XPUBLIC int main (argc, argv)
  359. Xint    argc; /* Number of arguments.*/
  360. XbStrT *argv; /* Points to array of argument strings.*/
  361. X{
  362. XbStrT end; /* Points to end of string.*/
  363. Xlong l; /* Returned by ma2l().*/
  364. X
  365. Xif (argc < 2) usage();
  366. Xl = ma2l (argv[1], (2 == argc) ? NULBSTR : &argv[1][atoi (argv[2])], FALSE,
  367. X          S("integer-numeric-literal"), &end);
  368. XPRINTF ("8#%lo#\t10#%ld#\t16#%lX#\t%s\n", l, l, l, end);
  369. Xmfflush (stdout, "Standard Output");
  370. Xexit (SUCCESS);
  371. X
  372. X#ifdef lint
  373. Xreturn (SUCCESS);
  374. X#endif
  375. X}
  376. X#endif
  377. END_OF_FILE
  378. if test 3037 -ne `wc -c <'ma2l.c'`; then
  379.     echo shar: \"'ma2l.c'\" unpacked with wrong size!
  380. fi
  381. # end of 'ma2l.c'
  382. fi
  383. if test -f 'malf0.c' -a "${1}" != "-c" ; then 
  384.   echo shar: Will not clobber existing file \"'malf0.c'\"
  385. else
  386. echo shar: Extracting \"'malf0.c'\" \(2751 characters\)
  387. sed "s/^X//" >'malf0.c' <<'END_OF_FILE'
  388. X/*
  389. X * malf0 - malf (0, ...)
  390. X */
  391. X
  392. X#ifndef lint
  393. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  394. X#endif lint
  395. X
  396. X/*
  397. X * This program is free software; you can redistribute it and/or modify
  398. X * it under the terms of the GNU General Public License version 1,
  399. X * as published by the Free Software Foundation.
  400. X *
  401. X * This program is distributed in the hope that it will be useful,
  402. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  403. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  404. X * GNU General Public License for more details.
  405. X *
  406. X * You should have received a copy of the GNU General Public License
  407. X * along with this program; if not, write to the Free Software
  408. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  409. X */
  410. X
  411. X#include <stdio.h>
  412. X#include <howard/port.h>
  413. X#include <howard/version.h>
  414. X
  415. XMODVER ("@(#)$Header: malf0.c,v 1.11 89/08/21 17:50:47 howard Exp $");
  416. X
  417. X#include <howard/malf.h>
  418. X
  419. X#ifdef NOVPRINTF
  420. X/*VARARGS1*/
  421. XPUBLIC void malf0 (a, b, c, d, e, f)
  422. XcStrT a;
  423. X{
  424. Xmalf (0, a, b, c, d, e, f);
  425. X}
  426. X#else  NOVPRINTF
  427. X#include <varargs.h>
  428. X#include <howard/registers.i>
  429. X
  430. X/*VARARGS0*/
  431. XPUBLIC void malf0 (va_alist)
  432. Xva_dcl
  433. X
  434. X/* Function:
  435. X *    malf0 (args...) == malf (0, args...)
  436. X */
  437. X{
  438. Xextern bStrT   _progn;        /* Version string.*/
  439. Xextern int     errno;         /* See intro(2).*/
  440. Xextern int     sys_nerr;      /* Maximum value of errno for which a
  441. X                   * text entry exists.*/
  442. Xextern cStrT   sys_errlist[]; /* Array of pointers to system error
  443. X                   * text, indexed by errno.*/
  444. Xextern cStrT   ctime();       /* (3).*/
  445. Xextern long    time();        /* (3C).*/
  446. XR1     int     se = errno;    /* Save errno.*/
  447. X       long    ut;            /* Current system time.*/
  448. X       va_list args;
  449. XR2     cStrT   a;             /* Format string.*/
  450. X
  451. Xva_start (args);
  452. Xa = va_arg (args, cStrT);
  453. XFFLUSH (stdout);
  454. XFPUTS ("\nWarning", stderr);
  455. Xif (isatty (fileno (stderr)))
  456. X   {
  457. X   FPUTS (": ", stderr);
  458. X   putspn();
  459. X   }
  460. Xelse
  461. X   {
  462. X   ut = time ((long *) NULL);
  463. X   FPRINTF (stderr, " message at %s", ctime (&ut));
  464. X   if (NULBSTR != _progn) FPRINTF (stderr, "   from: %s\n   ", _progn);
  465. X   }
  466. X(void) vfprintf (stderr, a, args);
  467. Xva_end (args);
  468. XPUTC ('\n', stderr);
  469. Xif (0 != se)
  470. X   {
  471. X   FPRINTF (stderr, "   System message %d", se);
  472. X   if ((0 < se) && (se <= sys_nerr)) FPRINTF (stderr, ": %s", sys_errlist[se]);
  473. X   PUTC ('\n', stderr);
  474. X   }
  475. XFFLUSH (stderr);
  476. Xerrno = 0;
  477. X}
  478. X#endif NOVPRINTF
  479. X
  480. X#ifdef TEST
  481. X#include <howard/usage.h>
  482. X
  483. XMAINVER ("@(#)$Header: malf0.c,v 1.11 89/08/21 17:50:47 howard Exp $");
  484. XUSAGE ("");
  485. X
  486. XPUBLIC int main (argc, argv)
  487. Xint    argc; /* Number of arguments.*/
  488. XbStrT *argv; /* Points to array of argument strings.*/
  489. X{
  490. Xextern int errno;
  491. X
  492. Xerrno = 10;
  493. Xmalf0 ("%c %s %d %ld %f", '1', "2", 3, 4L, 5.0);
  494. X}
  495. X#endif
  496. END_OF_FILE
  497. if test 2751 -ne `wc -c <'malf0.c'`; then
  498.     echo shar: \"'malf0.c'\" unpacked with wrong size!
  499. fi
  500. # end of 'malf0.c'
  501. fi
  502. if test -f 'malf1.c' -a "${1}" != "-c" ; then 
  503.   echo shar: Will not clobber existing file \"'malf1.c'\"
  504. else
  505. echo shar: Extracting \"'malf1.c'\" \(2766 characters\)
  506. sed "s/^X//" >'malf1.c' <<'END_OF_FILE'
  507. X/*
  508. X * malf1 - malf (1, ...)
  509. X */
  510. X
  511. X#ifndef lint
  512. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  513. X#endif lint
  514. X
  515. X/*
  516. X * This program is free software; you can redistribute it and/or modify
  517. X * it under the terms of the GNU General Public License version 1,
  518. X * as published by the Free Software Foundation.
  519. X *
  520. X * This program is distributed in the hope that it will be useful,
  521. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  522. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  523. X * GNU General Public License for more details.
  524. X *
  525. X * You should have received a copy of the GNU General Public License
  526. X * along with this program; if not, write to the Free Software
  527. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  528. X */
  529. X
  530. X#include <stdio.h>
  531. X#include <howard/port.h>
  532. X#include <howard/version.h>
  533. X
  534. XMODVER ("@(#)$Header: malf1.c,v 1.8 89/08/21 17:50:50 howard Exp $");
  535. X
  536. X#include <howard/malf.h>
  537. X
  538. X#ifdef NOVPRINTF
  539. X/*VARARGS1*/
  540. XPUBLIC void malf1 (a, b, c, d, e, f)
  541. XcStrT a;
  542. X{
  543. Xmalf (1, a, b, c, d, e, f);
  544. X}
  545. X#else  NOVPRINTF
  546. X#include <varargs.h>
  547. X#include <howard/registers.i>
  548. X
  549. X/*VARARGS0*/
  550. XPUBLIC void malf1 (va_alist)
  551. Xva_dcl
  552. X
  553. X/* Function:
  554. X *    malf1 (args...) == malf (1, args...)
  555. X */
  556. X{
  557. Xextern bStrT   _progn;        /* Version string.*/
  558. Xextern int     errno;         /* See intro(2).*/
  559. Xextern int     sys_nerr;      /* Maximum value of errno for which a
  560. X                     * text entry exists.*/
  561. Xextern cStrT   sys_errlist[]; /* Array of pointers to system error
  562. X                   * text, indexed by errno.*/
  563. Xextern cStrT   ctime();       /* (3).*/
  564. Xextern long    time();        /* (3C).*/
  565. XR1     int     se = errno;    /* Save errno.*/
  566. X       long    ut;            /* Current system time.*/
  567. X       va_list args;
  568. XR2     cStrT   a;             /* Format string.*/
  569. X
  570. Xva_start (args);
  571. Xa = va_arg (args, cStrT);
  572. XFFLUSH (stdout);
  573. XFPUTS ("\nError", stderr);
  574. Xif (isatty (fileno (stderr)))
  575. X   {
  576. X   FPUTS (": ", stderr);
  577. X   putspn();
  578. X   }
  579. Xelse
  580. X   {
  581. X   ut = time ((long *) NULL);
  582. X   FPRINTF (stderr, " message at %s", ctime (&ut));
  583. X   if (NULBSTR != _progn) FPRINTF (stderr, "   from: %s\n   ", _progn);
  584. X   }
  585. X(void) vfprintf (stderr, a, args);
  586. Xva_end (args);
  587. XPUTC ('\n', stderr);
  588. Xif (0 != se)
  589. X   {
  590. X   FPRINTF (stderr, "   System message %d", se);
  591. X   if ((0 < se) && (se <= sys_nerr)) FPRINTF (stderr, ": %s", sys_errlist[se]);
  592. X   PUTC ('\n', stderr);
  593. X   }
  594. XFFLUSH (stderr);
  595. Xif (_debug) abort();
  596. Xexit (1);
  597. X}
  598. X#endif VPRINTF
  599. X
  600. X#ifdef TEST
  601. X#include <howard/usage.h>
  602. X
  603. XMAINVER ("@(#)$Header: malf1.c,v 1.8 89/08/21 17:50:50 howard Exp $");
  604. XUSAGE ("");
  605. X
  606. XPUBLIC int main (argc, argv)
  607. Xint    argc; /* Number of arguments.*/
  608. XbStrT *argv; /* Points to array of argument strings.*/
  609. X{
  610. Xextern int errno;
  611. X
  612. Xerrno = 3;
  613. Xmalf1 ("%c %s %d %ld %f", '1', "2", 3, 4L, 5.0);
  614. X}
  615. X#endif
  616. END_OF_FILE
  617. if test 2766 -ne `wc -c <'malf1.c'`; then
  618.     echo shar: \"'malf1.c'\" unpacked with wrong size!
  619. fi
  620. # end of 'malf1.c'
  621. fi
  622. if test -f 'mk-cc-lims.b' -a "${1}" != "-c" ; then 
  623.   echo shar: Will not clobber existing file \"'mk-cc-lims.b'\"
  624. else
  625. echo shar: Extracting \"'mk-cc-lims.b'\" \(2539 characters\)
  626. sed "s/^X//" >'mk-cc-lims.b' <<'END_OF_FILE'
  627. X  
  628. X# mk-cc-lims - make the cc-lims.i include file for this C compiler
  629. X#
  630. X# $Header: mk-cc-lims.b,v 1.6 89/09/21 19:22:19 howard Exp $
  631. X#
  632. X# Copyright 1989 Howard Lee Gayle
  633. X# This file is written in the ISO 8859/1 character set.
  634. X#
  635. X# This program is free software; you can redistribute it and/or modify
  636. X# it under the terms of the GNU General Public License version 1,
  637. X# as published by the Free Software Foundation.
  638. X#
  639. X# This program is distributed in the hope that it will be useful,
  640. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  641. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  642. X# GNU General Public License for more details.
  643. X#
  644. X# You should have received a copy of the GNU General Public License
  645. X# along with this program; if not, write to the Free Software
  646. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  647. X#
  648. X# Shell variables:
  649. X# t - temporary file
  650. X# u - usage string
  651. X
  652. XCMDNAME=mk-cc-lims
  653. Xexport CMDNAME
  654. Xu='Usage: $CMDNAME c-compiler cc-lims.i'
  655. Xif [ $# -ne 2 ]
  656. Xthen
  657. X   echo "$u" 1>&2
  658. X   exit 1
  659. Xfi
  660. Xt=lims$$.c
  661. Xecho '/*' > $2
  662. Xecho ' * cc-lims.i - C compiler limitations file' >> $2
  663. Xecho ' *' >> $2
  664. Xecho ' * This file was generated automatically by:' >> $2
  665. Xecho ' *    $Header: mk-cc-lims.b,v 1.6 89/09/21 19:22:19 howard Exp $' >> $2
  666. Xecho ' */' >> $2
  667. Xecho '' >> $2
  668. Xecho 'main(){extern TYPE x();x(0);}' > $t
  669. X
  670. Xif $1 -S -DTYPE='signed char' $t
  671. Xthen
  672. X   echo '/*#define NOSCHAR 1 /* Comment in if no signed char type.*/' >> $2
  673. Xelse
  674. X   echo   '#define NOSCHAR 1 /* Comment in if no signed char type.*/' >> $2
  675. Xfi
  676. X
  677. Xif $1 -S -DTYPE='unsigned char' $t
  678. Xthen
  679. X   echo '/*#define NOUCHAR 1 /* Comment in if no unsigned char type.*/' >> $2
  680. Xelse
  681. X   echo   '#define NOUCHAR 1 /* Comment in if no unsigned char type.*/' >> $2
  682. Xfi
  683. X
  684. Xif $1 -S -DTYPE='unsigned long' $t
  685. Xthen
  686. X   echo '/*#define NOULONG 1 /* Comment in if no unsigned long type.*/' >> $2
  687. Xelse
  688. X   echo   '#define NOULONG 1 /* Comment in if no unsigned long type.*/' >> $2
  689. Xfi
  690. X
  691. Xif $1 -S -DTYPE='unsigned short' $t
  692. Xthen
  693. X   echo '/*#define NOUSHRT 1 /* Comment in if no unsigned short type.*/' >> $2
  694. Xelse
  695. X   echo   '#define NOUSHRT 1 /* Comment in if no unsigned short type.*/' >> $2
  696. Xfi
  697. X
  698. Xif $1 -S -DTYPE='void' $t
  699. Xthen
  700. X   echo '/*#define NOVOID  1 /* Comment in if no void type.*/' >> $2
  701. Xelse
  702. X   echo   '#define NOVOID  1 /* Comment in if no void type.*/' >> $2
  703. Xfi
  704. X
  705. Xif $1 -S -DTYPE='void *' $t
  706. Xthen
  707. X   echo '/*#define NOVOIDP 1 /* Comment in if no void * type.*/' >> $2
  708. Xelse
  709. X   echo   '#define NOVOIDP 1 /* Comment in if no void * type.*/' >> $2
  710. Xfi
  711. X
  712. Xrm $t lims$$.s
  713. END_OF_FILE
  714. if test 2539 -ne `wc -c <'mk-cc-lims.b'`; then
  715.     echo shar: \"'mk-cc-lims.b'\" unpacked with wrong size!
  716. fi
  717. # end of 'mk-cc-lims.b'
  718. fi
  719. if test -f 'mk-reg.b' -a "${1}" != "-c" ; then 
  720.   echo shar: Will not clobber existing file \"'mk-reg.b'\"
  721. else
  722. echo shar: Extracting \"'mk-reg.b'\" \(2374 characters\)
  723. sed "s/^X//" >'mk-reg.b' <<'END_OF_FILE'
  724. X  
  725. X# mk-reg - make registers.i file
  726. X#
  727. X# $Header: mk-reg.b,v 1.4 89/09/20 12:21:49 howard Exp $
  728. X#
  729. X# Copyright 1989 Howard Lee Gayle
  730. X# This file is written in the ISO 8859/1 character set.
  731. X#
  732. X# This program is free software; you can redistribute it and/or modify
  733. X# it under the terms of the GNU General Public License version 1,
  734. X# as published by the Free Software Foundation.
  735. X#
  736. X# This program is distributed in the hope that it will be useful,
  737. X# but WITHOUT ANY WARRANTY; without even the implied warranty of
  738. X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  739. X# GNU General Public License for more details.
  740. X#
  741. X# You should have received a copy of the GNU General Public License
  742. X# along with this program; if not, write to the Free Software
  743. X# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  744. X#
  745. X# Shell variables:
  746. X# a - output string
  747. X# b - output string
  748. X# c - .c temporary file
  749. X# i - loop counter
  750. X# m - max number of registers
  751. X# r - number of registers to try
  752. X# o - old .s file
  753. X# s - .s file
  754. X# u - usage string
  755. X
  756. XCMDNAME=mk-reg
  757. Xexport CMDNAME
  758. Xu="Usage: $CMDNAME c-compiler registers.i"
  759. Xc=reg$$.c
  760. Xm=32
  761. Xo=reg$$.sO
  762. Xr=0
  763. Xs=reg$$.s
  764. Xif [ $# -ne 2 ]
  765. Xthen
  766. X   echo "$u" 1>&2
  767. X   exit 1
  768. Xfi
  769. Xwhile [ $r -le $m ]
  770. Xdo
  771. X   echo "$r register(s)" 1>&2
  772. X   echo 't(){' > $c
  773. X   i=1
  774. X   while [ $i -le $m ]
  775. X   do
  776. X      if [ $i -le $r ]
  777. X      then
  778. X         a='register '
  779. X      else
  780. X         a=
  781. X      fi
  782. X      if [ 0 -eq `expr $i % 2` ]
  783. X      then
  784. X         b='char *'
  785. X      else
  786. X         b='int   '
  787. X      fi
  788. X      echo "$a${b}v$i;" >> $c
  789. X      i=`expr $i + 1`
  790. X   done
  791. X   echo 'return(' >> $c
  792. X   i=1
  793. X   while [ $i -le $m ]
  794. X   do
  795. X      if [ 0 -eq `expr $i % 2` ]
  796. X      then
  797. X         b='*'
  798. X      else
  799. X         b=
  800. X      fi
  801. X      echo "${b}v$i +" >> $c
  802. X      i=`expr $i + 1`
  803. X   done
  804. X   echo '0);}' >> $c
  805. X   $1 -S $c
  806. X   if [ 0 -eq $r ]
  807. X   then
  808. X      mv -f $s $o
  809. X   elif cmp -s $s $o
  810. X   then
  811. X      break
  812. X   else
  813. X      mv -f $s $o
  814. X   fi
  815. X   r=`expr $r + 1`
  816. Xdone
  817. Xecho '/*' > $2
  818. Xecho ' * registers.i - portable allocation of register variables' >> $2
  819. Xecho ' *' >> $2
  820. Xecho ' * This file was generated automatically by:' >> $2
  821. Xecho ' *    $Header: mk-reg.b,v 1.4 89/09/20 12:21:49 howard Exp $' >> $2
  822. Xecho ' */' >> $2
  823. Xecho '' >> $2
  824. Xi=1
  825. Xwhile [ $i -le $m ]
  826. Xdo
  827. X   if [ $i -lt $r ]
  828. X   then
  829. X      a=' register'
  830. X   else
  831. X      a=
  832. X   fi
  833. X   echo "#define R$i$a" >> $2
  834. X   i=`expr $i + 1`
  835. Xdone
  836. Xrm -f $c $o $s
  837. END_OF_FILE
  838. if test 2374 -ne `wc -c <'mk-reg.b'`; then
  839.     echo shar: \"'mk-reg.b'\" unpacked with wrong size!
  840. fi
  841. # end of 'mk-reg.b'
  842. fi
  843. if test -f 'mopenp.3' -a "${1}" != "-c" ; then 
  844.   echo shar: Will not clobber existing file \"'mopenp.3'\"
  845. else
  846. echo shar: Extracting \"'mopenp.3'\" \(2401 characters\)
  847. sed "s/^X//" >'mopenp.3' <<'END_OF_FILE'
  848. X.\" $Header: mopenp.3,v 1.1 89/08/13 16:20:15 howard Exp $
  849. X.TH MOPENP "3 -lhoward" "$Revision: 1.1 $" "Howard\'s C library" "Howard\'s C library"
  850. X.SH NAME
  851. Xmopenp \- search path for file and open it
  852. X.SH SYNOPSIS
  853. X.nf
  854. X.BR "#include <" stdio.h ">"
  855. X.BR "#include <" howard/port.h ">"
  856. X.BR "#include <" howard/malf.h ">"
  857. X.fi
  858. X.LP
  859. XstreamT mopenp (
  860. X.IR path ,
  861. X.IR separator ,
  862. X.IR simple ,
  863. X.IR suffix ,
  864. X.IR mode ,
  865. X.IR buffer ,
  866. X.IR length )
  867. X.nf
  868. X.RI "bStrT " path ;
  869. X.RI "rcharT " separator ;
  870. X.RI "bStrT " simple ;
  871. X.RI "bStrT " suffix ;
  872. X.RI "bStrT " mode ;
  873. X.RI "bStrT " buffer ;
  874. X.BI "unsigned " length;
  875. X.SH COPYRIGHT
  876. XCopyright \(co 1989 Howard Lee Gayle
  877. X.SH DESCRIPTION
  878. X.I Mopenp
  879. Xsearches the directory search path in
  880. X.I path
  881. Xfor a file named
  882. X.I simple
  883. Xwith suffix
  884. X.IR suffix ,
  885. Xopens the file by calling
  886. X.IR fopen (3S)
  887. Xwith the given
  888. X.IR mode ,
  889. Xthen returns the stream.
  890. XThe directories in the search path are separated by the
  891. X.I separator
  892. Xcharacter.
  893. XEach directory may end in "/", but need not do so.
  894. XThe full file name is assembled in the area to which
  895. X.I buffer
  896. Xpoints.
  897. X.I Length
  898. Xgives the number of bytes in this area.
  899. X.SH RETURNS
  900. XOn success, the stream corresponding to the opened file.
  901. XOn error,
  902. X.I mopenp
  903. Xcalls
  904. X.IR malf1 ,
  905. Xso there is no return.
  906. X.SH EXAMPLE
  907. XThis very contrived example searches first /usr/local/include,
  908. Xthen /usr/include for stdio.h, and opens it for reading.
  909. X.nf
  910. X   streamT is;
  911. X   byteT fnb[MFILE];
  912. X   is = mopenp (S("/usr/local/include:/usr/include"), ':',
  913. X                S("stdio"), S(".h"), S("r"), fnb, MFILE);
  914. X.fi
  915. X.SH "SEE ALSO"
  916. X.IR fopen (3S),
  917. X.IR malf "(3 -lhoward)."
  918. X.SH LICENSE
  919. XThis program is free software; you can redistribute it and/or modify
  920. Xit under the terms of the GNU General Public License version 1,
  921. Xas published by the Free Software Foundation.
  922. X.PP
  923. XThis program is distributed in the hope that it will be useful,
  924. Xbut WITHOUT ANY WARRANTY; without even the implied warranty of
  925. XMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  926. XGNU General Public License for more details.
  927. X.PP
  928. XYou should have received a copy of the GNU General Public License
  929. Xalong with this program; if not, write to the Free Software
  930. XFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  931. X.SH AUTHOR
  932. XHoward Gayle,
  933. XTN/ETX/T/BG,
  934. XEricsson Telecom AB,
  935. XS-126 25 Stockholm,
  936. XSweden,
  937. Xhoward@ericsson.se,
  938. Xuunet!ericsson.se!howard,
  939. XPhone: +46 8 719 5565,
  940. XFAX: +46 8 719 9598,
  941. XTelex: 14910 ERIC S
  942. END_OF_FILE
  943. if test 2401 -ne `wc -c <'mopenp.3'`; then
  944.     echo shar: \"'mopenp.3'\" unpacked with wrong size!
  945. fi
  946. # end of 'mopenp.3'
  947. fi
  948. if test -f 'mra2d.c' -a "${1}" != "-c" ; then 
  949.   echo shar: Will not clobber existing file \"'mra2d.c'\"
  950. else
  951. echo shar: Extracting \"'mra2d.c'\" \(2457 characters\)
  952. sed "s/^X//" >'mra2d.c' <<'END_OF_FILE'
  953. X/*
  954. X * mra2d - convert Ada-syntax real literal to double, check range
  955. X */
  956. X
  957. X#ifndef lint
  958. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  959. X#endif lint
  960. X
  961. X/*
  962. X * This program is free software; you can redistribute it and/or modify
  963. X * it under the terms of the GNU General Public License version 1,
  964. X * as published by the Free Software Foundation.
  965. X *
  966. X * This program is distributed in the hope that it will be useful,
  967. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  968. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  969. X * GNU General Public License for more details.
  970. X *
  971. X * You should have received a copy of the GNU General Public License
  972. X * along with this program; if not, write to the Free Software
  973. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  974. X */
  975. X
  976. X#include <stdio.h>
  977. X#include <howard/port.h>
  978. X#include <howard/version.h>
  979. X
  980. XMODVER ("@(#)$Header: mra2d.c,v 1.5 89/08/12 10:43:12 howard Exp $");
  981. X
  982. X#include <limits.h>
  983. X#include <howard/a2.h>
  984. X#include <howard/malf.h>
  985. X#include <howard/registers.i>
  986. X
  987. XPUBLIC double mra2d (str, lim, synok, fn, lo, hi, end)
  988. XbStrT   str;   /* Input string.*/
  989. XbStrT   lim;   /* Don't pass this.*/
  990. XboolT   synok; /* Accept non-fatal syntax errors.*/
  991. XbStrT   fn;    /* Field name, for error messages.*/
  992. Xdouble  lo;    /* Minimum legal value.*/
  993. Xdouble  hi;    /* Maximum legal value.*/
  994. XbStrT  *end;   /* End pointer stored here.*/
  995. X
  996. X/* Function:
  997. X *    
  998. X * Algorithm:
  999. X *    Call ma2d() then do a range check.
  1000. X * Returns:
  1001. X *    
  1002. X * Notes:
  1003. X *    
  1004. X */
  1005. X{
  1006. Xdouble d; /* Returned by ma2d().*/
  1007. X
  1008. Xd = ma2d (str, lim, synok, fn, end);
  1009. Xif ((d < lo) || (d > hi))
  1010. X   malf1 ("%s [%.*s] not in range [%G, %G]", fn,
  1011. X          (NULBSTR == lim) ? INT_MAX : lim - str, str, lo, hi);
  1012. Xreturn (d);
  1013. X}
  1014. X
  1015. X#ifdef TEST
  1016. X#include <howard/usage.h>
  1017. X
  1018. XMAINVER ("@(#)$Header: mra2d.c,v 1.5 89/08/12 10:43:12 howard Exp $");
  1019. XUSAGE ("real-numeric-literal lo hi");
  1020. X
  1021. XPUBLIC int main (argc, argv)
  1022. Xint    argc; /* Number of arguments.*/
  1023. XbStrT *argv; /* Points to array of argument strings.*/
  1024. X{
  1025. XbStrT end; /* End of string.*/
  1026. Xdouble d; /* Returned by mra2d().*/
  1027. X
  1028. Xif (4 != argc) usage();
  1029. Xd = mra2d (argv[1], NULBSTR, TRUE, S("real-numeric-literal"),
  1030. X           ma2d (argv[2], NULBSTR, FALSE, S("lo"), (bStrT *) NULL),
  1031. X           ma2d (argv[3], NULBSTR, FALSE, S("hi"), (bStrT *) NULL),
  1032. X           &end);
  1033. XPRINTF ("%G\t%s\n", d, end);
  1034. Xmfflush (stdout, "Standard Output");
  1035. Xexit (SUCCESS);
  1036. X
  1037. X#ifdef lint
  1038. Xreturn (SUCCESS);
  1039. X#endif
  1040. X}
  1041. X#endif
  1042. END_OF_FILE
  1043. if test 2457 -ne `wc -c <'mra2d.c'`; then
  1044.     echo shar: \"'mra2d.c'\" unpacked with wrong size!
  1045. fi
  1046. # end of 'mra2d.c'
  1047. fi
  1048. if test -f 'mra2i.c' -a "${1}" != "-c" ; then 
  1049.   echo shar: Will not clobber existing file \"'mra2i.c'\"
  1050. else
  1051. echo shar: Extracting \"'mra2i.c'\" \(2470 characters\)
  1052. sed "s/^X//" >'mra2i.c' <<'END_OF_FILE'
  1053. X/*
  1054. X * mra2i - convert Ada-syntax integer literal to int, check range
  1055. X */
  1056. X
  1057. X#ifndef lint
  1058. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  1059. X#endif lint
  1060. X
  1061. X/*
  1062. X * This program is free software; you can redistribute it and/or modify
  1063. X * it under the terms of the GNU General Public License version 1,
  1064. X * as published by the Free Software Foundation.
  1065. X *
  1066. X * This program is distributed in the hope that it will be useful,
  1067. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1068. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1069. X * GNU General Public License for more details.
  1070. X *
  1071. X * You should have received a copy of the GNU General Public License
  1072. X * along with this program; if not, write to the Free Software
  1073. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1074. X */
  1075. X
  1076. X#include <stdio.h>
  1077. X#include <howard/port.h>
  1078. X#include <howard/version.h>
  1079. X
  1080. XMODVER ("@(#)$Header: mra2i.c,v 1.5 89/08/13 07:35:40 howard Exp $");
  1081. X
  1082. X#include <limits.h>
  1083. X#include <howard/a2.h>
  1084. X#include <howard/malf.h>
  1085. X#include <howard/registers.i>
  1086. X
  1087. XPUBLIC int mra2i (str, lim, synok, fn, lo, hi, end)
  1088. XbStrT  str;   /* Input string.*/
  1089. XbStrT  lim;   /* Don't pass this.*/
  1090. XboolT  synok; /* Accept non-fatal syntax errors.*/
  1091. XbStrT  fn;    /* Field name, for error messages.*/
  1092. Xint    lo;    /* Minimum legal value.*/
  1093. Xint    hi;    /* Maximum legal value.*/
  1094. XbStrT *end;   /* End pointer stored here.*/
  1095. X
  1096. X/* Function:
  1097. X *    
  1098. X * Algorithm:
  1099. X *    Call ma2i() then range check.
  1100. X * Returns:
  1101. X *    
  1102. X * Notes:
  1103. X *    
  1104. X */
  1105. X{
  1106. XR1 int i; /* Returned by ma2i().*/
  1107. X
  1108. Xi = ma2i (str, lim, synok, fn, end);
  1109. Xif ((i < lo) || (i > hi))
  1110. X   malf1 ("%s [%.*s] not in range [%d, %d]", fn,
  1111. X          (NULBSTR == lim) ? INT_MAX : lim - str, str, lo, hi);
  1112. Xreturn (i);
  1113. X}
  1114. X
  1115. X#ifdef TEST
  1116. X#include <howard/usage.h>
  1117. X
  1118. XMAINVER ("@(#)$Header: mra2i.c,v 1.5 89/08/13 07:35:40 howard Exp $");
  1119. XUSAGE ("integer-numeric-literal lo hi");
  1120. X
  1121. XPUBLIC int main (argc, argv)
  1122. Xint    argc; /* Number of arguments.*/
  1123. XbStrT *argv; /* Points to array of argument strings.*/
  1124. X{
  1125. XbStrT end; /* End of string.*/
  1126. Xint i; /* Returned by mra2i().*/
  1127. X
  1128. Xif (4 != argc) usage();
  1129. Xi = mra2i (argv[1], NULBSTR, TRUE, S("integer-numeric-literal"),
  1130. X           ma2i (argv[2], NULBSTR, FALSE, S("lo"), (bStrT *) NULL),
  1131. X           ma2i (argv[3], NULBSTR, FALSE, S("hi"), (bStrT *) NULL),
  1132. X           &end);
  1133. XPRINTF ("8#%o#\t10#%d#\t16#%X#\t%s\n", i, i, i, end);
  1134. Xmfflush (stdout, "Standard Output");
  1135. Xexit (SUCCESS);
  1136. X
  1137. X#ifdef lint
  1138. Xreturn (SUCCESS);
  1139. X#endif
  1140. X}
  1141. X#endif
  1142. END_OF_FILE
  1143. if test 2470 -ne `wc -c <'mra2i.c'`; then
  1144.     echo shar: \"'mra2i.c'\" unpacked with wrong size!
  1145. fi
  1146. # end of 'mra2i.c'
  1147. fi
  1148. if test -f 'mra2l.c' -a "${1}" != "-c" ; then 
  1149.   echo shar: Will not clobber existing file \"'mra2l.c'\"
  1150. else
  1151. echo shar: Extracting \"'mra2l.c'\" \(2476 characters\)
  1152. sed "s/^X//" >'mra2l.c' <<'END_OF_FILE'
  1153. X/*
  1154. X * mra2u - convert Ada-syntax integer literal to long, check range
  1155. X */
  1156. X
  1157. X#ifndef lint
  1158. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  1159. X#endif lint
  1160. X
  1161. X/*
  1162. X * This program is free software; you can redistribute it and/or modify
  1163. X * it under the terms of the GNU General Public License version 1,
  1164. X * as published by the Free Software Foundation.
  1165. X *
  1166. X * This program is distributed in the hope that it will be useful,
  1167. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1168. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1169. X * GNU General Public License for more details.
  1170. X *
  1171. X * You should have received a copy of the GNU General Public License
  1172. X * along with this program; if not, write to the Free Software
  1173. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1174. X */
  1175. X
  1176. X#include <stdio.h>
  1177. X#include <howard/port.h>
  1178. X#include <howard/version.h>
  1179. X
  1180. XMODVER ("@(#)$Header: mra2l.c,v 1.2 89/08/13 08:05:51 howard Exp $");
  1181. X
  1182. X#include <limits.h>
  1183. X#include <howard/a2.h>
  1184. X#include <howard/malf.h>
  1185. X#include <howard/registers.i>
  1186. X
  1187. XPUBLIC long mra2l (str, lim, synok, fn, lo, hi, end)
  1188. XbStrT  str;   /* Input string.*/
  1189. XbStrT  lim;   /* Don't pass this.*/
  1190. XboolT  synok; /* Accept non-fatal syntax errors.*/
  1191. XbStrT  fn;    /* Field name, for error messages.*/
  1192. Xlong   lo;    /* Minimum legal value.*/
  1193. Xlong   hi;    /* Maximum legal value.*/
  1194. XbStrT *end;   /* End pointer stored here.*/
  1195. X
  1196. X/* Function:
  1197. X *    
  1198. X * Algorithm:
  1199. X *    Call ma2l() then range check.
  1200. X * Returns:
  1201. X *    
  1202. X * Notes:
  1203. X *    
  1204. X */
  1205. X{
  1206. Xlong l; /* Returned by ma2l().*/
  1207. X
  1208. Xl = ma2l (str, lim, synok, fn, end);
  1209. Xif ((l < lo) || (l > hi))
  1210. X   malf1 ("%s [%.*s] not in range [%ld, %ld]", fn,
  1211. X          (NULBSTR == lim) ? INT_MAX : lim - str, str, lo, hi);
  1212. Xreturn (l);
  1213. X}
  1214. X
  1215. X#ifdef TEST
  1216. X#include <howard/usage.h>
  1217. X
  1218. XMAINVER ("@(#)$Header: mra2l.c,v 1.2 89/08/13 08:05:51 howard Exp $");
  1219. XUSAGE ("integer-numeric-literal lo hi");
  1220. X
  1221. XPUBLIC int main (argc, argv)
  1222. Xint    argc; /* Number of arguments.*/
  1223. XbStrT *argv; /* Points to array of argument strings.*/
  1224. X{
  1225. XbStrT end; /* End of string.*/
  1226. Xlong l; /* Returned by mra2l().*/
  1227. X
  1228. Xif (4 != argc) usage();
  1229. Xl = mra2l (argv[1], NULBSTR, TRUE, S("integer-numeric-literal"),
  1230. X           ma2l (argv[2], NULBSTR, FALSE, S("lo"), (bStrT *) NULL),
  1231. X           ma2l (argv[3], NULBSTR, FALSE, S("hi"), (bStrT *) NULL),
  1232. X           &end);
  1233. XPRINTF ("8#%lo#\t10#%ld#\t16#%lX#\t%s\n", l, l, l, end);
  1234. Xmfflush (stdout, "Standard Output");
  1235. Xexit (SUCCESS);
  1236. X
  1237. X#ifdef lint
  1238. Xreturn (SUCCESS);
  1239. X#endif
  1240. X}
  1241. X#endif
  1242. END_OF_FILE
  1243. if test 2476 -ne `wc -c <'mra2l.c'`; then
  1244.     echo shar: \"'mra2l.c'\" unpacked with wrong size!
  1245. fi
  1246. # end of 'mra2l.c'
  1247. fi
  1248. if test -f 'mra2u.c' -a "${1}" != "-c" ; then 
  1249.   echo shar: Will not clobber existing file \"'mra2u.c'\"
  1250. else
  1251. echo shar: Extracting \"'mra2u.c'\" \(2511 characters\)
  1252. sed "s/^X//" >'mra2u.c' <<'END_OF_FILE'
  1253. X/*
  1254. X * mra2u - convert Ada-syntax integer literal to unsigned, check range
  1255. X */
  1256. X
  1257. X#ifndef lint
  1258. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  1259. X#endif lint
  1260. X
  1261. X/*
  1262. X * This program is free software; you can redistribute it and/or modify
  1263. X * it under the terms of the GNU General Public License version 1,
  1264. X * as published by the Free Software Foundation.
  1265. X *
  1266. X * This program is distributed in the hope that it will be useful,
  1267. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1268. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1269. X * GNU General Public License for more details.
  1270. X *
  1271. X * You should have received a copy of the GNU General Public License
  1272. X * along with this program; if not, write to the Free Software
  1273. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1274. X */
  1275. X
  1276. X#include <stdio.h>
  1277. X#include <howard/port.h>
  1278. X#include <howard/version.h>
  1279. X
  1280. XMODVER ("@(#)$Header: mra2u.c,v 1.4 89/08/13 07:46:02 howard Exp $");
  1281. X
  1282. X#include <limits.h>
  1283. X#include <howard/a2.h>
  1284. X#include <howard/malf.h>
  1285. X#include <howard/registers.i>
  1286. X
  1287. XPUBLIC unsigned mra2u (str, lim, synok, fn, lo, hi, end)
  1288. XbStrT     str;   /* Input string.*/
  1289. XbStrT     lim;   /* Don't pass this.*/
  1290. XboolT     synok; /* Accept non-fatal syntax errors.*/
  1291. XbStrT     fn;    /* Field name, for error messages.*/
  1292. Xunsigned  lo;    /* Minimum legal value.*/
  1293. Xunsigned  hi;    /* Maximum legal value.*/
  1294. XbStrT    *end;   /* End pointer stored here.*/
  1295. X
  1296. X/* Function:
  1297. X *    
  1298. X * Algorithm:
  1299. X *    Call ma2u() then range check.
  1300. X * Returns:
  1301. X *    
  1302. X * Notes:
  1303. X *    
  1304. X */
  1305. X{
  1306. XR1 unsigned u; /* Returned by ma2u().*/
  1307. X
  1308. Xu = ma2u (str, lim, synok, fn, end);
  1309. Xif ((u < lo) || (u > hi))
  1310. X   malf1 ("%s [%.*s] not in range [%u, %u]", fn,
  1311. X          (NULBSTR == lim) ? INT_MAX : lim - str, str, lo, hi);
  1312. Xreturn (u);
  1313. X}
  1314. X
  1315. X#ifdef TEST
  1316. X#include <howard/usage.h>
  1317. X
  1318. XMAINVER ("@(#)$Header: mra2u.c,v 1.4 89/08/13 07:46:02 howard Exp $");
  1319. XUSAGE ("integer-numeric-literal lo hi");
  1320. X
  1321. XPUBLIC int main (argc, argv)
  1322. Xint    argc; /* Number of arguments.*/
  1323. XbStrT *argv; /* Points to array of argument strings.*/
  1324. X{
  1325. XbStrT end; /* End of string.*/
  1326. Xunsigned u; /* Returned by mra2u().*/
  1327. X
  1328. Xif (4 != argc) usage();
  1329. Xu = mra2u (argv[1], NULBSTR, TRUE, S("integer-numeric-literal"),
  1330. X           ma2u (argv[2], NULBSTR, FALSE, S("lo"), (bStrT *) NULL),
  1331. X           ma2u (argv[3], NULBSTR, FALSE, S("hi"), (bStrT *) NULL),
  1332. X           &end);
  1333. XPRINTF ("8#%o#\t10#%u#\t16#%X#\t%s\n", u, u, u, end);
  1334. Xmfflush (stdout, "Standard Output");
  1335. Xexit (SUCCESS);
  1336. X
  1337. X#ifdef lint
  1338. Xreturn (SUCCESS);
  1339. X#endif
  1340. X}
  1341. X#endif
  1342. END_OF_FILE
  1343. if test 2511 -ne `wc -c <'mra2u.c'`; then
  1344.     echo shar: \"'mra2u.c'\" unpacked with wrong size!
  1345. fi
  1346. # end of 'mra2u.c'
  1347. fi
  1348. if test -f 'mra2ul.c' -a "${1}" != "-c" ; then 
  1349.   echo shar: Will not clobber existing file \"'mra2ul.c'\"
  1350. else
  1351. echo shar: Extracting \"'mra2ul.c'\" \(2508 characters\)
  1352. sed "s/^X//" >'mra2ul.c' <<'END_OF_FILE'
  1353. X/*
  1354. X * mra2u - convert Ada-syntax integer literal to unsigned long, check range
  1355. X */
  1356. X
  1357. X#ifndef lint
  1358. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  1359. X#endif lint
  1360. X
  1361. X/*
  1362. X * This program is free software; you can redistribute it and/or modify
  1363. X * it under the terms of the GNU General Public License version 1,
  1364. X * as published by the Free Software Foundation.
  1365. X *
  1366. X * This program is distributed in the hope that it will be useful,
  1367. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1368. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1369. X * GNU General Public License for more details.
  1370. X *
  1371. X * You should have received a copy of the GNU General Public License
  1372. X * along with this program; if not, write to the Free Software
  1373. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1374. X */
  1375. X
  1376. X#include <stdio.h>
  1377. X#include <howard/port.h>
  1378. X#include <howard/version.h>
  1379. X
  1380. XMODVER ("@(#)$Header: mra2ul.c,v 1.2 89/08/13 08:20:50 howard Exp $");
  1381. X
  1382. X#include <limits.h>
  1383. X#include <howard/a2.h>
  1384. X#include <howard/malf.h>
  1385. X#include <howard/registers.i>
  1386. X
  1387. XPUBLIC ulongT mra2ul (str, lim, synok, fn, lo, hi, end)
  1388. XbStrT   str;   /* Input string.*/
  1389. XbStrT   lim;   /* Don't pass this.*/
  1390. XboolT   synok; /* Accept non-fatal syntax errors.*/
  1391. XbStrT   fn;    /* Field name, for error messages.*/
  1392. XulongT  lo;    /* Minimum legal value.*/
  1393. XulongT  hi;    /* Maximum legal value.*/
  1394. XbStrT  *end;   /* End pointer stored here.*/
  1395. X
  1396. X/* Function:
  1397. X *    
  1398. X * Algorithm:
  1399. X *    Call ma2ul() then range check.
  1400. X * Returns:
  1401. X *    
  1402. X * Notes:
  1403. X *    
  1404. X */
  1405. X{
  1406. XulongT l; /* Returned by ma2ul().*/
  1407. X
  1408. Xl = ma2ul (str, lim, synok, fn, end);
  1409. Xif ((l < lo) || (l > hi))
  1410. X   malf1 ("%s [%.*s] not in range [%lu, %lu]", fn,
  1411. X          (NULBSTR == lim) ? INT_MAX : lim - str, str, lo, hi);
  1412. Xreturn (l);
  1413. X}
  1414. X
  1415. X#ifdef TEST
  1416. X#include <howard/usage.h>
  1417. X
  1418. XMAINVER ("@(#)$Header: mra2ul.c,v 1.2 89/08/13 08:20:50 howard Exp $");
  1419. XUSAGE ("integer-numeric-literal lo hi");
  1420. X
  1421. XPUBLIC int main (argc, argv)
  1422. Xint    argc; /* Number of arguments.*/
  1423. XbStrT *argv; /* Points to array of argument strings.*/
  1424. X{
  1425. XbStrT end; /* End of string.*/
  1426. XulongT l; /* Returned by mra2ul().*/
  1427. X
  1428. Xif (4 != argc) usage();
  1429. Xl = mra2ul (argv[1], NULBSTR, TRUE, S("integer-numeric-literal"),
  1430. X           ma2ul (argv[2], NULBSTR, FALSE, S("lo"), (bStrT *) NULL),
  1431. X           ma2ul (argv[3], NULBSTR, FALSE, S("hi"), (bStrT *) NULL),
  1432. X           &end);
  1433. XPRINTF ("8#%lo#\t10#%lu#\t16#%lX#\t%s\n", l, l, l, end);
  1434. Xmfflush (stdout, "Standard Output");
  1435. Xexit (SUCCESS);
  1436. X
  1437. X#ifdef lint
  1438. Xreturn (SUCCESS);
  1439. X#endif
  1440. X}
  1441. X#endif
  1442. END_OF_FILE
  1443. if test 2508 -ne `wc -c <'mra2ul.c'`; then
  1444.     echo shar: \"'mra2ul.c'\" unpacked with wrong size!
  1445. fi
  1446. # end of 'mra2ul.c'
  1447. fi
  1448. if test -f 'prefxi.c' -a "${1}" != "-c" ; then 
  1449.   echo shar: Will not clobber existing file \"'prefxi.c'\"
  1450. else
  1451. echo shar: Extracting \"'prefxi.c'\" \(2330 characters\)
  1452. sed "s/^X//" >'prefxi.c' <<'END_OF_FILE'
  1453. X/*
  1454. X * prefxi - Test if one string is prefix of another.  Ignore case.
  1455. X */
  1456. X
  1457. X#ifndef lint
  1458. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  1459. X#endif lint
  1460. X
  1461. X/*
  1462. X * This program is free software; you can redistribute it and/or modify
  1463. X * it under the terms of the GNU General Public License version 1,
  1464. X * as published by the Free Software Foundation.
  1465. X *
  1466. X * This program is distributed in the hope that it will be useful,
  1467. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1468. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1469. X * GNU General Public License for more details.
  1470. X *
  1471. X * You should have received a copy of the GNU General Public License
  1472. X * along with this program; if not, write to the Free Software
  1473. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1474. X */
  1475. X
  1476. X#include <stdio.h>
  1477. X#include <howard/port.h>
  1478. X#include <howard/version.h>
  1479. X
  1480. XMODVER ("@(#)$Header: prefxi.c,v 1.1 89/08/19 10:31:17 howard Exp $");
  1481. X
  1482. X#include <ctype.h>
  1483. X#include <howard/malf.h>
  1484. X#include <howard/registers.i>
  1485. X
  1486. XPUBLIC bStrT prefxi (p, s)
  1487. XR1 bStrT p; /* The candidate prefix.*/
  1488. XR2 bStrT s; /* The string to test.*/
  1489. X
  1490. X/* Function:
  1491. X *    Test if p is a prefix of s.
  1492. X * Algorithm:
  1493. X *    Compare the strings character by character.
  1494. X * Returns:
  1495. X *    If p is a prefix of s, a pointer to the character in s
  1496. X *    just after the last character of the prefix.
  1497. X *    If p is not a prefix of s, NULBSTR.
  1498. X * Notes:
  1499. X *    
  1500. X */
  1501. X{
  1502. XR3 rcharT a; /* Current character from p.*/
  1503. XR4 rcharT b; /* Current character from s.*/
  1504. X
  1505. Xif (NULBSTR == p) malf1 ("prefxi: NULL prefix");
  1506. Xif (NULBSTR == s) malf1 ("prefxi: NULL string");
  1507. Xfor (;;)
  1508. X   {
  1509. X   a = B(*p);
  1510. X   if (EOS == a) return (s);
  1511. X   if (isascii (a) && isupper (a)) a = tolower (a);
  1512. X   b = B(*s);
  1513. X   if (isascii (b) && isupper (b)) b = tolower (b);
  1514. X   if (a != b) return (NULBSTR);
  1515. X   ++p;
  1516. X   ++s;
  1517. X   }
  1518. X}
  1519. X
  1520. X#ifdef TEST
  1521. X#include <howard/usage.h>
  1522. X
  1523. XMAINVER ("@(#)$Header: prefxi.c,v 1.1 89/08/19 10:31:17 howard Exp $");
  1524. XUSAGE ("prefix string");
  1525. X
  1526. XPUBLIC int main (argc, argv)
  1527. Xint    argc; /* Number of arguments.*/
  1528. XbStrT *argv; /* Points to array of argument strings.*/
  1529. X{
  1530. XbStrT r; /* Returned by prefxi().*/
  1531. X
  1532. Xif (3 != argc) usage();
  1533. Xr = prefxi (argv[1], argv[2]);
  1534. Xif (NULBSTR != r) PUTS (r);
  1535. Xmfflush (stdout, S("Standard Output"));
  1536. Xexit (SUCCESS);
  1537. X
  1538. X#ifdef lint
  1539. Xreturn (SUCCESS);
  1540. X#endif
  1541. X}
  1542. X#endif
  1543. END_OF_FILE
  1544. if test 2330 -ne `wc -c <'prefxi.c'`; then
  1545.     echo shar: \"'prefxi.c'\" unpacked with wrong size!
  1546. fi
  1547. # end of 'prefxi.c'
  1548. fi
  1549. if test -f 'usage.h' -a "${1}" != "-c" ; then 
  1550.   echo shar: Will not clobber existing file \"'usage.h'\"
  1551. else
  1552. echo shar: Extracting \"'usage.h'\" \(268 characters\)
  1553. sed "s/^X//" >'usage.h' <<'END_OF_FILE'
  1554. X/* usage.h - For usage() funtion to print usage string and exit.
  1555. X *
  1556. X * $Header: usage.h,v 1.1 88/08/21 09:02:44 howard Exp $
  1557. X *
  1558. X * Prerequisites: howard/port.h, howard/version.h.
  1559. X */
  1560. X#define USAGE(x) bStrT _usage = ((bStrT)(x)) /* Usage string.*/
  1561. XPUBLIC void usage();
  1562. END_OF_FILE
  1563. if test 268 -ne `wc -c <'usage.h'`; then
  1564.     echo shar: \"'usage.h'\" unpacked with wrong size!
  1565. fi
  1566. # end of 'usage.h'
  1567. fi
  1568. if test -f 'userfn.c' -a "${1}" != "-c" ; then 
  1569.   echo shar: Will not clobber existing file \"'userfn.c'\"
  1570. else
  1571. echo shar: Extracting \"'userfn.c'\" \(2371 characters\)
  1572. sed "s/^X//" >'userfn.c' <<'END_OF_FILE'
  1573. X/*
  1574. X * userfn - get user's full name
  1575. X */
  1576. X
  1577. X#ifndef lint
  1578. Xstatic char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
  1579. X#endif lint
  1580. X
  1581. X/*
  1582. X * This program is free software; you can redistribute it and/or modify
  1583. X * it under the terms of the GNU General Public License version 1,
  1584. X * as published by the Free Software Foundation.
  1585. X *
  1586. X * This program is distributed in the hope that it will be useful,
  1587. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  1588. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1589. X * GNU General Public License for more details.
  1590. X *
  1591. X * You should have received a copy of the GNU General Public License
  1592. X * along with this program; if not, write to the Free Software
  1593. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1594. X */
  1595. X
  1596. X#include <stdio.h>
  1597. X#include <howard/port.h>
  1598. X#include <howard/version.h>
  1599. X
  1600. XMODVER ("@(#)$Header: userfn.c,v 1.2 89/08/20 11:30:07 howard Exp $");
  1601. X
  1602. X#include <pwd.h>
  1603. X#include <howard/malf.h>
  1604. X#include <howard/registers.i>
  1605. X
  1606. XPUBLIC bStrT userfn (fnb)
  1607. XR3 bStrT fnb; /* Store full name here.*/
  1608. X
  1609. X/* Function:
  1610. X *    
  1611. X * Algorithm:
  1612. X *    Try getlogin() for the login name.  Otherwise use the real user ID
  1613. X *    to get the password entry.  Call getpwf().
  1614. X * Returns:
  1615. X *    
  1616. X * Notes:
  1617. X *    1) The idea with getlogin() is that sometimes several lines in
  1618. X *       the password file have the same UID.  If getlogin() comes
  1619. X *       back with a login name, then getpwnam() should return the
  1620. X *       corresponding password entry.
  1621. X */
  1622. X{
  1623. XR1     cStrT          ln;         /* Login name of user.*/
  1624. XR2     struct passwd *pwp;        /* Returned by getpwuid(). See getpwent(3).*/
  1625. Xextern cStrT          getlogin(); /* (3).*/
  1626. Xextern int            getuid();   /* (2).*/
  1627. X
  1628. Xif (NULBSTR == fnb) malf1 ("userfn: no buffer");
  1629. Xln = getlogin();
  1630. Xpwp = ((NULCSTR == ln) ? getpwuid (getuid()) : getpwnam (ln));
  1631. Xreturn ((((struct passwd *) NULL) == pwp) ? NULBSTR : getpwf (pwp, fnb));
  1632. X}
  1633. X
  1634. X#ifdef TEST
  1635. X#include <howard/usage.h>
  1636. X
  1637. XMAINVER ("@(#)$Header: userfn.c,v 1.2 89/08/20 11:30:07 howard Exp $");
  1638. XUSAGE ("");
  1639. X
  1640. XPUBLIC int main (argc, argv)
  1641. Xint    argc; /* Number of arguments.*/
  1642. XbStrT *argv; /* Points to array of argument strings.*/
  1643. X{
  1644. XbyteT fnb[1024]; /* Full name buffer.*/
  1645. X
  1646. Xif (1 != argc) usage();
  1647. X(void) userfn (fnb);
  1648. XPUTS (fnb);
  1649. Xmfflush (stdout, S("Standard Output"));
  1650. Xexit (SUCCESS);
  1651. X
  1652. X#ifdef lint
  1653. Xreturn (SUCCESS);
  1654. X#endif
  1655. X}
  1656. X#endif
  1657. END_OF_FILE
  1658. if test 2371 -ne `wc -c <'userfn.c'`; then
  1659.     echo shar: \"'userfn.c'\" unpacked with wrong size!
  1660. fi
  1661. # end of 'userfn.c'
  1662. fi
  1663. echo shar: End of archive 6 \(of 9\).
  1664. cp /dev/null ark6isdone
  1665. MISSING=""
  1666. for I in 1 2 3 4 5 6 7 8 9 ; do
  1667.     if test ! -f ark${I}isdone ; then
  1668.     MISSING="${MISSING} ${I}"
  1669.     fi
  1670. done
  1671. if test "${MISSING}" = "" ; then
  1672.     echo You have unpacked all 9 archives.
  1673.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1674. else
  1675.     echo You still need to unpack the following archives:
  1676.     echo "        " ${MISSING}
  1677. fi
  1678. ##  End of shell archive.
  1679. exit 0
  1680.  
  1681.